package mahongyuan1521005.com.myhttp;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by 13271 on 2017/12/13.
 */

public class student_Activity extends Activity {
    private List<Map<String, Object>> listItems = new ArrayList<Map<String, Object>>();    // 创建一个list集合
    private SimpleAdapter simpleAdapter;// 创建ArrayAdapter对象
    private ListView listView;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.stu);
        listView = (ListView) findViewById(R.id.list);
        simpleAdapter = new SimpleAdapter(this,
                listItems,
                R.layout.layout,
                new String[]{"text1", "text2"},
                new int[]{R.id.text1, R.id.text2}
        );
        listView.setAdapter(simpleAdapter);


//        Map<String, Object> map = new HashMap<String, Object>();
//        map.put("text1", "HDJSHD");
//        map.put("text2", "JSJJ");
//        listItems.add(map);

    }
}
